how to read data from image in python